import numpy as np
import pandas as pd

# Twolayer select

# data = pd.read_csv(r'./NNPredictData/Two_layer_Sum_Params_Good.csv', header=None)
#
# data.columns = ['Hidden', 'MSE', 'MAE', 'R2']
#
# data_10 = data.sort_values(by=['R2', 'MAE'], ascending=[False, True])
# data_10 = data['R2'].sort_values()
# data_20 = data['MSE'].sort_values()
# data_30 = data['MAE'].sort_values()
#
# print(data_10)
# print(data_20)
# print(data_30)

# Threelayer select
data = pd.read_csv(r'./NNPredictData/Three_layer_Sum_Params.csv', header=None)

data.columns = ['Hidden1', 'Hidden2 ', 'MSE', 'MAE', 'R2']

data_sort = data.sort_values(by=['R2', 'MAE'], ascending=[False, True])
print(data_sort.head(18))


# R2
# 0     0.000000
# 1     0.000000
# 2     0.000000
# 19    0.132428
# 12    0.133039
# 11    0.143428
# 10    0.155722
# 9     0.158727
# 13    0.159657
# 8     0.173841
# 14    0.176653
# 4     0.178648
# 15    0.180617
# 16    0.191081
# 7     0.192403
# 5     0.194703
# 18    0.196428
# 3     0.209021
# 6     0.215530
# 25    0.221071
# 28    0.236220
# 24    0.244509
# 27    0.252896
# 20    0.266187
# 26    0.272793
# 23    0.274814
# 21    0.306154
# 22    0.313324
# 17    0.389775
# MSE
# 17    0.198314
# 18    0.658222
# 22    1.107259
# 0     1.188604
# 24    1.219264
# 21    1.243477
# 28    1.245773
# 26    1.247568
# 27    1.282963
# 23    1.285818
# 25    1.376530
# 16    1.409987
# 15    1.481515
# 20    1.508958
# 14    1.537446
# 6     1.549536
# 13    1.633421
# 9     1.723217
# 11    1.733764
# 12    1.744826
# 10    1.783827
# 5     1.789190
# 8     1.813958
# 3     1.826698
# 7     1.946657
# 4     1.964119
# 19    1.982125
# 2     2.392273
# 1     2.913823
# MAE
# 17    0.186148
# 18    0.300784
# 22    0.357752
# 21    0.379973
# 26    0.395029
# 24    0.396595
# 28    0.405621
# 23    0.406511
# 27    0.410393
# 25    0.426665
# 20    0.432514
# 16    0.441152
# 15    0.456613
# 0     0.457270
# 14    0.465197
# 6     0.465317
# 13    0.484793
# 9     0.497600
# 11    0.505356
# 12    0.508969
# 10    0.509790
# 8     0.511835
# 3     0.515705
# 5     0.517811
# 7     0.534936
# 19    0.537361
# 4     0.542624
# 2     0.643362
# 1     0.734744


#      Hidden1  Hidden2        MSE       MAE        R2
# 4        5.0       9.0  0.877985  0.334246  0.220625
# 6        5.0      11.0  0.799377  0.322412  0.202452
# 5        5.0      10.0  0.856919  0.333028  0.185805
# 152     12.0      17.0  1.185922  0.401819  0.184377
# 153     12.0      18.0  1.213516  0.408257  0.180598
# 3        5.0       8.0  1.055577  0.378129  0.178681
# 151     12.0      16.0  1.206223  0.406419  0.177992
# 150     12.0      15.0  1.225503  0.410293  0.177404
# 7        5.0      12.0  1.096969  0.385425  0.177065
# 154     12.0      19.0  1.205546  0.406863  0.176943
# 156     12.0      21.0  1.198915  0.405624  0.176326
# 149     12.0      14.0  1.241990  0.413453  0.174411
# 155     12.0      20.0  1.214071  0.408863  0.173395
# 157     12.0      22.0  1.204165  0.407879  0.172918
# 158     12.0      23.0  1.220554  0.412332  0.169698
# 165     13.0      10.0  1.229500  0.412264  0.167230
# 166     13.0      11.0  1.228648  0.412441  0.167199
# 159     12.0      24.0  1.213779  0.411188  0.166593